package game.objects;
import game.Game;
import game.engine.GSync;
import graphics.objects.GStupidLine;
import graphics.system.Color;
import physics.joints.JAngleJoint;
import physics.joints.JBackgroundAngleJoint;
import physics.joints.JBackgroundDistanceJoint;
import physics.joints.JDistanceJoint;
import physics.tools.Initializer;
import tools.Help;
import tools.Point;
public class GODistanceJointTester extends GameObject {
	public GODistanceJointTester(Game g, Point pos) {
		super(g, pos);
	}
	@Override
	public void handle() {
	}
	@Override
	public void initialize(Point pos) {
		addBodyWithGraphics(Initializer.getRectangle(pos.add(10, 0), 40, 100, 4.0f, 0.0f), new Color(1, 0, 0, 1));
		addBodyWithGraphics(Initializer.getRectangle(pos.add(-30, 0), 40, 30, 1.0f), new Color(1, 0, 0, 1));
		Point p1 = getBody(0).pos.add(30, 0);
		addJoint(new JDistanceJoint(getBody(0), getBody(1), p1, p1, 0));
		addGraphicsObject(new GStupidLine(p1, p1, 0.0f, new Color(1, 0, 0, 0)), new GSync(getJoint(0)));
		// addJoint(new JBackgroundAngleJoint(getBody(0), 0));//, getBody(1)));
		addJoint(new JAngleJoint(getBody(0), getBody(1), 0.0f));
		// addJoint(new JBackgroundDistanceJoint(getBody(0), getBody(0).pos, new
		// Point(300, 300), 0.0f));
	}
}
